package com.totoro.mapper;

import com.totoro.pojo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author TOTORO
 * @date 2021/7/12 9:39
 */
@Repository
public interface ShopMapper {

    Integer findShopIdByPid(@Param("pid") int pid);

    Shop findShopBySlid(@Param("slid") int slid);

    Shop findShopBySid(@Param("sid") int sid);

    Integer[] randomFindFiveShopId();

    List<Product> findShopMaxDealProduct(@Param("shopIds") Integer[] shopIds);

    Shop findAllProduct(@Param("sid") int sid, @Param("limit1") int limit1, @Param("limit2") int limit2);

    List<Product> findTermDescProduct(@Param("sid") int sid, @Param("descSql") String descSql);


    List<Product> findAllShopCategoryAndProduct(@Param("scid") int scid, @Param("keyWord") String keyWord, @Param("descSql") String descSql, @Param("lowPrice") double lowPrice, @Param("highPrice") double highPrice, @Param("curr") int curr);

    List<Product> keywordSearchShopProduct(@Param("sid") int sid, @Param("keyWord") String keyWord, @Param("descSql") String descSql, @Param("lowPrice") double lowPrice, @Param("highPrice") double highPrice, @Param("curr") int curr);

    List<ShopCategory> findAllShopCategory(@Param("sid") int sid);

    Integer checkShopCategoryName(ShopCategory shopCategory);

    Integer addShopCategory(@Param("scName") String scName, @Param("sid") int sid);

    Integer addProductGoToCategory(@Param("scid") int scid, @Param("pid") int pid);

    Integer deleteShopCategory(@Param("scid") int scid);

    Integer updateCategoryProductEmpty(@Param("scid") int scid);

    Integer updateShopStar(ProductComment productComment);

    Shop findOtherMaxScore(@Param("slid") int slid);

    List<ShopSwitchImage> findShopSwitchImage(@Param("sid") int sid, @Param("imagePath") String ImagePath);

    Integer addShopAccess(@Param("sid") int sid);

    List<DayCount> findShopDayAccessCount(@Param("sid") int sid);

    Integer addShopPay(@Param("sid") int sid, @Param("payMoney") double payMoney);

    List<DayCount> findShopDayPayMoney(@Param("sid") int sid);

    List<DayCount> findShopDayPayChildOrder(@Param("sid") int sid);

    List<DayCount> findShopDayPayUserCount(@Param("sid") int sid);

    Integer collectShop(@Param("uid") int uid, @Param("sid") int sid);

    CollectShop checkUserCollectShop(@Param("uid") int uid, @Param("sid") int sid);

    List<CollectShop> findAllUserCollectShop(@Param("uid") int uid, @Param("keyword") String keyword);

    List<Product> findCollectShop(@Param("sid") int sid);

    Integer cancelCollectShop(@Param("uid") int uid, @Param("sid") int sid);

    Integer updateShopCollectCount(@Param("type") int type, @Param("sid") int sid);

    Integer batchReduceShopCollectCount(@Param("collectIds") Integer[] collectIds);

    Integer batchDeleteCollectShop(@Param("collectIds") Integer[] collectIds);

}
